﻿@{
    ViewBag.Title = "Index";
    List<Mobile_VTBL.Models.DTO.SubCategory> Events = ViewBag.SubCategory;
    List<Mobile_VTBL.Models.DTO.ProductList> Products = ViewBag.Products;

    Mobile_VTBL.UI.UserContext CTX = new Mobile_VTBL.UI.UserContext();
}
<div class="manufacture">
    <span id="manufacturetitle">Xem tất cả</span>
    @Html.DropDownList("ddlSubCategory", new SelectList(ViewBag.SubCategory, "ID", "Name"), new { @class = "manufacture" })
</div>
<div id="Product_Searching">
    <ul class="product-list">
        @foreach (var Product in Products)
        { 
            <li class="item">
                <ol>
                    <li class="image">
                        <a href="/Chi-Tiet/@Product.ID/@CTX.RemoveAccents(Product.Name)">
                            <img src="http://vienthongbaolam.com/Images/Product/@Product.Images" alt="@Product.Name" />
                        </a>
                    </li>
                    <li class="info">
                        <h4>
                            <a href="/Chi-Tiet/@Product.ID/@CTX.RemoveAccents(Product.Name)">
                                @Product.Name
                            </a>
                        </h4>
                        <a class="link" href="/Chi-Tiet/@Product.ID/@CTX.RemoveAccents(Product.Name)">Xem chi tiết</a>
                    </li>
                </ol>
            </li>
        }
    </ul>
</div>

<div class="paging">@MvcHtmlString.Create(Mobile_VTBL.UI.UserContext.GetPageLinks(ViewBag.TotalPages, ViewBag.CurrentPage, "Page"))</div>
<script type="text/javascript">
    $(function () {
        $('#ddlSubCategory').val('@ViewBag.Id');
        $('#manufacturetitle').text($('#ddlSubCategory option:selected').text());
    })
</script>
